import { http } from '@/utils/https'

//根据设备ID绑定/解绑设备
export const bindDeviceApi = (data: { bindFlg: 0 | 1; deviceNum: string; userId: number }) => {
  return http({
    url: '/person/device/bind',
    method: 'POST',
    data,
  })
}
//修改用户名和头像
export const changeUserInfoApi = (data: { nickname: string; picture: string; userId: number }) => {
  return http({
    url: '/person/updateUser',
    method: 'POST',
    data,
  })
}
//获取用户信息
export const getUserInfoApi = (userId: number) => {
  return http<{
    nickname: string
    picture: string
    phone: string
    openId: string
  }>({
    url: `/person/userInfo/${userId}`,
    method: 'POST',
  })
}
